<template>
  <div class="permission">
    <div class="desc">
      <div>
        <ep-title :title="moduleTitle"></ep-title>
        <ep-count text="数据量" :count="headerInfo.count" unit="条"></ep-count>
        <ep-time
          style="margin-left: 15px"
          text="当前任务截止时间："
          :timer="headerInfo.c0305"
        ></ep-time>
        <!--        2023-02-24 23:59-->
      </div>
      <div>
        <ep-proofread
          text="已排查："
          :count="headerInfo.checkCount"
          unit="条"
        ></ep-proofread>
        <ep-proofread
          style="margin-left: 15px"
          text="未排查："
          :count="headerInfo.noCheckCount"
          unit="条"
        ></ep-proofread>
        <ep-progress
          style="margin-left: 15px"
          width="150px"
          :percent="headerInfo.taskPlan"
        />
      </div>
    </div>
    <!--    <zh-row :span="24" style="height: 100%; flex-direction: column">
      <zh-col>
        <zh-form ref="userQueryFrom" :model="queryParam">
          <zh-input
              prop="taskArea"
              type="tree"
              mode="multiple"
              label="管理区域"
              placeholder="支持多选"
              ref="taskArea"
              allowClear
              tree-checkable
              multiple
              v-model="queryParam.manageAreas"
              :treeData="taskAreaTree"
              :showCheckedStrategy="SHOW_PARENT"
              :span="16"
              style="float: left"
              :labelCol="{ span: 3 }"
              :wrapperCol="{ span: 10 }"
              @change="manageAreaChange()"
          >
          </zh-input>
        </zh-form>
      </zh-col>
    </zh-row>-->
    <div class="condition">
      <div>
        <div style="flex: 0 0 auto">
          <ep-search
              :size="size"
            v-model="queryParam.b0102"
            placeholder="输入点位名称搜索"
            enter-button="搜索"
            @search="onSearch"
          ></ep-search>
        </div>
        <ep-button
            :size="size"
          style="margin-left: 15px"
          icon="refresh.svg"
          @click="refresh"
        ></ep-button>
        <a-tree-select
            :size="size"
          placeholder="请选择管理区域(可多选)"
          ref="taskArea"
          allowClear
          tree-checkable
          style="margin-left: 15px; width: 22vw"
          v-model="queryParam.manageAreas"
          :show-checked-strategy="SHOW_PARENT"
          :treeData="taskAreaTree"
          @change="manageAreaChange()"
        />
        <!--        <div class="field">
          <ep-button icon="field.svg" @click="fieldVisible = !fieldVisible"
          >字段展示</ep-button
          >
          <div class="field-box" v-if="fieldVisible">
            <ul>
              <li v-for="(column, index) in columns" :key="index">
                <vxe-checkbox v-model="column.visible" :key="index">{{
                    column.title
                  }}</vxe-checkbox>
              </li>
            </ul>
            <div class="btn">
              <p @click="fieldConfirm">确认</p>
              <p @click="fieldRevert">还原</p>
            </div>
          </div>
        </div>-->
        <column-manage
          :column.sync="columns"
          @change="columnChange"
        ></column-manage>
      </div>
      <div>
        <ep-button
            :size="size"
          style="margin-left: 15px"
          icon="export.svg"
          @click="exportFile"
          >导出</ep-button
        >
      </div>
    </div>
    <div class="ep-table">
      <vxe-table
        border="none"
        stripe
        ref="xTable"
        align="center"
        :height="tableHeight"
        :data="tableData"
        :loading="loading"
        @checkbox-all="selectAllEvent"
        @checkbox-change="selectChangeEvent"
        :filter-config="{ remote: true }"
        @filter-change="filterChange"
        :sort-config="{ remote: true, multiple: true }"
        @sort-change="sortChange"
      >
        <vxe-column type="checkbox" width="60"></vxe-column>
        <vxe-column type="seq" title="序号" width="60"></vxe-column>
        <!--        <vxe-column field="b0128" title="点位序号" width="100"></vxe-column>-->
        <vxe-column field="b0102" title="点位名称" width="100"></vxe-column>
        <vxe-column field="b0103" title="文物编号" width="90"></vxe-column>
        <vxe-column
          field="b0104Name"
          title="古系列类别"
          :filters="[]"
          :filterMultiple="true"
          width="130"
        ></vxe-column>
        <vxe-column
          field="b0105Name"
          title="文保等级"
          sortable
          width="150"
        ></vxe-column>
        <vxe-column
          field="b0106Name"
          title="时代"
          sortable
          width="120"
        ></vxe-column>
        <!--        <vxe-column field="b0107" title="县市区" :filters="sqData"
                    :filterMultiple=false width="120"></vxe-column>
        <vxe-column field="b0108" title="街道" :filters="jdDataBuild"
                    :filterMultiple=true width="120"></vxe-column>-->
        <vxe-column
          field="manageArea"
          title="管理区域"
          width="200"
        ></vxe-column>
        <vxe-column
          field="b0109"
          title="地址"
          width="150"
          show-overflow
        ></vxe-column>
        <vxe-column
          field="b0116"
          title="详情"
          width="100"
          show-overflow
        ></vxe-column>
        <vxe-column
          field="b0113Name"
          title="是否核销"
          :filters="[
            { label: '是', value: '1' },
            { label: '否', value: '0' },
          ]"
          :filterMultiple="false"
          width="110"
        ></vxe-column>
        <vxe-column
          field="b0114Name"
          title="是否安全"
          :filters="[
            { label: '是', value: '1' },
            { label: '否', value: '0' },
          ]"
          :filterMultiple="false"
          width="110"
        ></vxe-column>
        <vxe-column
          field="b0115Name"
          title="是否划定保护双线"
          :filters="[
            { label: '是', value: '1' },
            { label: '否', value: '0' },
          ]"
          :filterMultiple="false"
          width="180"
        ></vxe-column>
        <vxe-column
          field="b0117Name"
          title="省级文保类别"
          :filters="[]"
          :filterMultiple="true"
          width="140"
        ></vxe-column>
        <vxe-column
          field="b0118Name"
          title="省级文保子类"
          width="120"
        ></vxe-column>
        <vxe-column
          field="b0121"
          title="开放时间"
          sortable
          width="150"
        ></vxe-column>
        <vxe-column field="b03Info" title="监控设备" width="150"></vxe-column>
        <vxe-column
          field="c0304"
          title="排查开始时间"
          sortable
          width="140"
        ></vxe-column>
        <vxe-column
          field="c0305"
          title="排查截止时间"
          sortable
          width="140"
        ></vxe-column>
        <vxe-column field="c0302" title="任务名称" width="100" :filters="[]"
                    :filterMultiple="true" fixed="right"></vxe-column>
        <vxe-column
          field="c0103Name"
          title="排查状态"
          fixed="right"
          width="100"
        ></vxe-column>
        <vxe-column
          field="c0105"
          title="审核状态"
          width="110"
          fixed="right"
          :filters="[
            { label: '审核通过', value: '1' },
            { label: '待审核', value: '0' },
          ]"
          :filterMultiple="false"
        >
          <template slot-scope="scope">
            <template v-if="scope.row.c0105 === '0'||scope.row.c0105 === '3'">
              <span :class="'examine-' + scope.row.c0105">{{
                scope.row.c0105 | examine
              }}</span>
            </template>
            <template v-else>
              <a-tooltip placement="top" overlayClassName="r-reason">
                <template #title>
                  <span>点击查看理由</span>
                </template>
                <span
                  :class="'examine-' + scope.row.c0105"
                  @click="checkReason(scope.row)"
                  >{{ scope.row.c0105 | examine }}</span
                >
              </a-tooltip>
            </template>
          </template>
        </vxe-column>
        <vxe-column field="operate" title="操作" width="100" fixed="right">
          <template slot-scope="scope">
            <ep-button size="small" type="rank" @click="operate(scope.row)">{{
              scope.row.c0103 | operation
            }}</ep-button>
          </template>
        </vxe-column>
      </vxe-table>
      <vxe-pager
        :layouts="[
          'Sizes',
          'PrevJump',
          'PrevPage',
          'Number',
          'NextPage',
          'NextJump',
          'FullJump',
          'PageCount',
          'Total',
        ]"
        :current-page.sync="pageInfo.currentPage"
        :page-size.sync="pageInfo.pageSize"
        :total="pageInfo.total"
        :page-sizes="[200, 500, 1000, 5000, 10000]"
        @page-change="handlePageChange"
      >
      </vxe-pager>
    </div>
    <reason-dialog
      v-if="reasonVisible"
      title="驳回理由"
      :reason="reasonText"
      @close="reasonVisible = false"
    />
    <form-dialog
      v-if="formVisible"
      :title="formTitle"
      :form="form"
      @close="formVisible = false"
    />
    <a-modal
      :title="modalTitle"
      centered
      style="top: 20px"
      width="80%"
      destroyOnClose
      v-model="visible"
    >
      <pointInfo
        ref="pointInfo"
        :b0101="objectInfo.b0101"
        :saveFlag="saveFlag"
        :c0303="queryParam.c0303"
      />
      <template v-slot:footer>
        <!--        <a-popconfirm-->
        <!--            v-if="modalTitle === 排查'"-->
        <!--            title="你确认要提交所有数据吗?"-->
        <!--            ok-text="是"-->
        <!--            cancel-text="否"-->
        <!--            @confirm="handleForm"-->
        <!--        >-->
        <!--          <a-button type="danger">提交</a-button>-->
        <!--        </a-popconfirm>-->
        <a-button
          v-if="modalTitle === '排查'"
          type="danger"
          @click="showConfirm"
          >提交</a-button
        >
      </template>
    </a-modal>
  </div>
</template>

<script>
import reasonDialog from "../taskCheck/components/reasonDialog.vue";
import formDialog from "../taskCheck/components/formDialog.vue";
import pointInfo from "@/pages/whdngxl/pointInfo";
import { getBatchDict, getDictCondition } from "@/services/system/api";
import { getPermissionParams, getSQAndJD } from "@/services/system/whdngxlApi";
import {
  getResourceObjectListForTaskCheck,
  checkResource,
  getHeaderInfo,
  getTheTotalTaskForOneself
} from "@/services/system/whdngxlApi";
import modal from "ant-design-vue/lib/modal";
import { isEmptyStr } from "@/utils/util";
import ColumnManage from "@/components/assembly/columnManage";
import { TreeSelect } from "ant-design-vue";
import {mapGetters} from "vuex";
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
export default {
  name: "taskCheck",
  computed: {
    ...mapGetters(['size']),
  },
  components: { ColumnManage, reasonDialog, formDialog, pointInfo },
  data() {
    return {
      moduleTitle: null,
      dictData: [],
      //查询表单
      queryParam: {
        b0102: null,
        c0303: null,
        filterVOList: [],
        orderVOList: [],
        manageAreas: undefined,
      },
      taskAreaTree: [],
      SHOW_PARENT,
      selectRuleBuild: {},
      orderRuleBuild: {},
      //查询规则
      selectRule: {
        c0302: {
          data: null,
          values: [],
          fuzzyQuery: false,
          multiple: true,
          targetField: "c0301",
        },
        c0303: {
          data: null,
          values: [],
          fuzzyQuery: false,
          multiple: false,
          targetField: "c0303",
        },
        b0102: {
          data: null,
          values: [],
          fuzzyQuery: true,
          multiple: false,
          targetField: "b0102",
        },
        b0104Name: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0104",
        },
        b0105: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0105",
        },
        b0106: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0106",
        },
        c0105: {
          data: null,
          values: [],
          multiple: true,
          targetField: "c0105",
        },
        b0113: {
          data: null,
          values: [],
          multiple: false,
          targetField: "b0113",
        },
        b0114: {
          data: null,
          values: [],
          multiple: false,
          targetField: "b0114",
        },
        b0115: {
          data: null,
          values: [],
          multiple: false,
          targetField: "b0115",
        },
        b0107: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0122",
        },
        b0108: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0123",
        },
        b0113Name: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0113",
        },
        b0114Name: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0114",
        },
        b0117Name: {
          data: null,
          values: [],
          multiple: true,
          targetField: "b0117",
        },
      },
      //排序规则
      orderRule: {
        b0105Name: {
          targetField: "b0105",
          order: null,
        },
        b0106Name: {
          targetField: "b0106",
          order: null,
        },
        b0121: {
          targetField: "b0121",
          order: null,
        },
        c0304: {
          targetField: "c0304",
          order: null,
        },
        c0305: {
          targetField: "c0305",
          order: null,
        },
      },
      columns: [],
      tableData: [],
      loading: false,
      pageInfo: {
        total: null,
        currentPage: 1,
        pageSize: 200,
      },
      sqData: [], //市区数据
      jdData: [], //街道数据
      jdDataBuild: [],
      headerInfo: {
        count: 0,
        checkCount: 0,
        noCheckCount: 0,
        taskPlan: 0,
        c0305: "",
      },
      //弹出框相关参数
      modalTitle: null,
      visible: false,
      b0101: null,
      saveFlag: false,
      //选中对象
      objectInfo: {
        b0101: null,
        c0101: null,
      },

      fieldVisible: false,
      tableHeight: 0,
      checkRecords: [],
      reasonVisible: false,
      reasonText: "",
      formVisible: false,
      formTitle: "新增点位",
      form: {},
      c03VOList: []
    };
  },
  created() {
    this.moduleTitle = this.$route.meta.title;
    if (this.$router.currentRoute.name === "URResourcesCheck") {
      //不可移动文物
      // this.moduleTitle = '不可移动文物'
      this.queryParam.c0303 = "1";
    } else if (this.$router.currentRoute.name === "TreeResourcesCheck") {
      //古树古木
      // this.moduleTitle = '古树古木'
      this.queryParam.c0303 = "2";
    } else if (this.$router.currentRoute.name === "RoadResourcesCheck") {
      //古道
      // this.moduleTitle = '古道'
      this.queryParam.c0303 = "3";
    }
    //获取任务范围
    this.$http.post(getPermissionParams, {}).then((res) => {
      const data = res.result;
      this.taskAreaTree = data.orgTreeData;
    });
    //数据字典初始化
    this.$http
      .post(getBatchDict, { dictFields: "B0104,B0106,C0105,B0113,B0114,B0117" })
      .then((res) => {
        this.dictData = res.result;
        Object.keys(this.dictData).forEach((key) => {
          this.dictData[key].forEach((e) => {
            e.label = e.dictValue;
            e.value = e.dictKey;
          });
        });
        const xTable = this.$refs.xTable;
        const column = xTable.getColumnByField("b0104Name");
        // 修改筛选列表
        xTable.setFilter(column, this.dictData.B0104);
        xTable.setFilter(
          xTable.getColumnByField("b0117Name"),
          this.dictData.B0117
        );
      });
    this.$http
      .post(getDictCondition, {
        dictField: "B0105",
        classify: this.queryParam.c0303,
      })
      .then((res) => {
        const b0105 = res.result;
        b0105.forEach((e) => {
          e.label = e.dictValue;
          e.value = e.dictKey;
        });
        this.$set(this.dictData, "B0105", b0105);
      });
    this.$http.post(getSQAndJD, {}).then((res) => {
      this.sqData = res.result.sqData;
      this.sqData.forEach((item) => {
        item.label = item.orgName;
        item.value = item.orgId;
      });
      this.jdData = res.result.jdData;
      Object.keys(this.jdData).forEach((key) => {
        this.jdData[key].forEach((e) => {
          e.label = e.orgName;
          e.value = e.orgId;
        });
      });
      const xTable = this.$refs.xTable;
      const column = xTable.getColumnByField("b0107");
      // 修改筛选列表
      xTable.setFilter(column, this.sqData);
    });
  },
  mounted() {
    this.$nextTick(() => {
      //个人排查时，获取总任务
      this.$http.post(getTheTotalTaskForOneself, {c0303: this.queryParam.c0303}).then((res) => {
        this.c03VOList = res.result
        this.c03VOList.forEach((item) => {
          item.label = item.c0302;
          item.value = item.c0301;
        });
        // 修改筛选列表
        const xTable = this.$refs.xTable;
        const column = xTable.getColumnByField("c0302");
        xTable.setFilter(column, this.c03VOList);
      }).finally(()=>{
        if(!isEmptyStr(this.$route.params.c0301)){
          // this.queryParam.c0302 = this.$route.params.c0302
          this.selectRuleBuild = JSON.parse(JSON.stringify(this.selectRule));
          const xTable = this.$refs.xTable
          this.c03VOList.forEach((item,index) =>{
            if(item.c0301 === this.$route.params.c0301){
              const c0302List = []
              c0302List.push(this.$route.params.c0301)
              this.selectRuleBuild.c0302.values = c0302List
              const c0302Column = xTable.getColumnByField('c0302')
              c0302Column.filters[index].checked = true
            }
          })
          const column = xTable.getColumnByField('c0105')
          // 修改第二个选项为勾选状态
          const option = column.filters[1]
          option.checked = true
          // 修改条件之后，需要手动调用 updateData 处理表格数据
          xTable.updateData()
          this.selectRuleBuild.c0105.values = ['0']
        }
        this.findGJResourceForTaskCheck();
        this.columns = this.$refs.xTable.getColumns();
      })
    });
    this.$nextTick(() => {
      this.getTableHeight();
    });
    window.addEventListener("resize", this.getTableHeight);
  },
  filters: {
    examine(val) {
      let obj = {
        0: "待审核",
        1: "审核通过",
        2: "驳回",
        3: "审核中",
      };
      return obj[val] || "";
    },
    operation(val) {
      let obj = {
        0: "排查",
        1: "查看",
      };
      return obj[val] || "查看";
    },
  },
  methods: {
    showConfirm() {
      const that = this;
      this.$confirm({
        title: "你确认要提交所有数据吗?",
        content: (h) => (
          <div style="color:red;">确认以后数据将直接进行提交审核</div>
        ),
        onOk() {
          console.log("OK");
          that.handleForm();
        },
        onCancel() {
          console.log("Cancel");
        },
        class: "test",
      });
    },
    manageAreaChange() {
      this.findGJResourceForTaskCheck();
    },
    //获取任务排查模块头部信息
    getHeaderInfo() {
      this.$http
        .post(getHeaderInfo, {
          c0303: this.queryParam.c0303,
          manageAreas: this.queryParam.manageAreas,
          c0301List: this.selectRuleBuild.c0302.values.length > 0? this.selectRuleBuild.c0302.values: undefined
        })
        .then((res) => {
          this.headerInfo = res.result;
        });
    },
    // 查询排查古迹资源信息
    findGJResourceForTaskCheck() {
      if (JSON.stringify(this.selectRuleBuild) === "{}") {
        this.selectRuleBuild = JSON.parse(JSON.stringify(this.selectRule));
      }
      const filterVOList = [];
      Object.keys(this.queryParam).forEach((key) => {
        const fieldRule = this.selectRuleBuild[key];
        if (fieldRule) {
          if (fieldRule.multiple) {
            fieldRule.values = this.queryParam[key];
          } else {
            fieldRule.data = this.queryParam[key];
          }
        }
      });
      Object.keys(this.selectRuleBuild).forEach((key) => {
        if (this.selectRuleBuild[key].data) {
          filterVOList.push({
            property: this.selectRuleBuild[key].targetField,
            data: this.selectRuleBuild[key].data,
            fuzzyQuery: this.selectRuleBuild[key].fuzzyQuery,
          });
        } else if (this.selectRuleBuild[key].values.length > 0) {
          filterVOList.push({
            property: this.selectRuleBuild[key].targetField,
            values: this.selectRuleBuild[key].values,
          });
        }
      });
      const orderVOList = [];
      Object.keys(this.orderRuleBuild).forEach((key) => {
        if (this.orderRuleBuild[key].order) {
          orderVOList.push({
            property: this.orderRuleBuild[key].targetField,
            order: this.orderRuleBuild[key].order,
          });
        }
      })
      this.queryParam.filterVOList = filterVOList;
      this.queryParam.orderVOList = orderVOList;
      this.queryParam.pageNum = this.pageInfo.currentPage;
      this.queryParam.pageSize = this.pageInfo.pageSize;
      this.loading = true;
      this.$http
        .post(getResourceObjectListForTaskCheck, this.queryParam)
        .then((res) => {
          this.loading = false;
          const data = res.result;
          this.tableData = data.list;
          this.pageInfo.currentPage = data.pageNum;
          this.pageInfo.pageSize = data.pageSize;
          this.pageInfo.total = data.total;
        })
        .catch((err) => {
          this.loading = false;
        });
      this.getHeaderInfo()
    },
    columnChange() {
      this.$refs.xTable.refreshColumn();
    },
    //筛选
    filterChange({ column, property, values, datas, filterList, $event }) {
      console.log(column);
      console.log(property);
      console.log(values);
      console.log(datas);
      console.log(filterList);
      console.log($event);
      //更改街道筛选字段
      if (property === "b0107") {
        this.jdDataBuild = this.jdData[values[0]];
        const xTable = this.$refs.xTable;
        const column = xTable.getColumnByField("b0108");
        // 修改筛选列表，并默认设置为选中状态
        xTable.setFilter(column, this.jdDataBuild);
      }
      //构建多字段筛选参数
      this.selectRuleBuild = JSON.parse(JSON.stringify(this.selectRule));
      filterList.forEach((item) => {
        const fieldRule = this.selectRuleBuild[item.field];
        if (fieldRule) {
          if (fieldRule.multiple) {
            fieldRule.values = item.values;
          }
        }
      });
      console.log(this.selectRuleBuild);
      this.findGJResourceForTaskCheck();
    },
    //排序
    sortChange({ column, property, order, sortBy, sortList, $event }) {
      console.log(column);
      console.log(property);
      console.log(order);
      console.log(sortBy);
      console.log(sortList);
      console.log($event);
      this.orderRuleBuild = JSON.parse(JSON.stringify(this.orderRule));
      sortList.forEach((item) => {
        if (this.orderRuleBuild[item.field]) {
          this.orderRuleBuild[item.field].order = item.order;
        }
      });
      this.findGJResourceForTaskCheck();
    },
    // 搜索
    onSearch() {
      this.findGJResourceForTaskCheck();
    },
    // 刷新
    refresh() {
      this.$refs.xTable.clearFilter();
      this.selectRuleBuild = JSON.parse(JSON.stringify(this.selectRule));
      this.queryParam.b0102 = null;
      this.findGJResourceForTaskCheck();
    },
    // 字段展示- 筛选确认
    fieldConfirm() {
      this.fieldVisible = false;
      this.$refs.xTable.refreshColumn();
    },
    // 字段展示-还原
    fieldRevert() {
      this.fieldVisible = false;
      this.columns.forEach((el) => {
        el.visible = true;
      });
      this.$refs.xTable.refreshColumn();
    },
    // 导出
    exportFile() {},
    // 选择框
    selectChangeEvent() {
      this.checkRecords = this.$refs.xTable.getCheckboxRecords();
    },
    // 选择框-all
    selectAllEvent() {
      this.checkRecords = this.$refs.xTable.getCheckboxRecords();
    },
    // 驳回理由
    checkReason(row) {
      this.reasonText = row.reason || "不符合要求";
      this.reasonVisible = true;
    },
    // 操作
    operate(row) {
      if (row.c0103 === "0") {
        //未排查，进行排查
        this.modalTitle = "排查";
        this.visible = true;
        this.objectInfo.b0101 = row.b0101;
        this.objectInfo.c0101 = row.c0101;
        this.saveFlag = false;
      } else {
        //已排查，进行查询
        this.modalTitle = "查看";
        this.visible = true;
        this.objectInfo.b0101 = row.b0101;
        this.saveFlag = true;
      }
    },
    //处理表单数据
    handleForm() {
      if (this.modalTitle === "查看") {
        this.visible = false;
        return;
      }
      this.$refs.pointInfo.saveOrUpdate().then((formData) => {
        formData.c0303 = this.queryParam.c0303;
        formData.b0110 = formData.b0111 + "," + formData.b0112;
        formData.c0101 = this.objectInfo.c0101;
        formData.b0132 = formData.b0132.join(',');
        if (formData.b0101 && formData.c0101) {
          //排查
          this.$http.post(checkResource, formData).then((res) => {
            modal.info({ title: "成功提示", content: "排查成功",maskClosable: true});
            this.visible = false;
            this.findGJResourceForTaskCheck();
          });
        }
      });
    },
    // 分页
    handlePageChange({ currentPage, pageSize }) {
      this.pageInfo.currentPage = currentPage;
      this.pageInfo.pageSize = pageSize;
      this.findGJResourceForTaskCheck();
    },
    // 表格高度
    getTableHeight() {
      this.$nextTick(() => {
        this.tableHeight = window.innerHeight - 371;
      });
    },
  },
  beforeRouteLeave(to, from, next) {
    window.removeEventListener("resize", this.getTableHeight);
    next();
  },
};
</script>
<style lang="less" scoped>
.permission {
  //padding: 15px 20px 0;
  height: 100%;
  .desc,
  .condition {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    > div {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
    }
    .field {
      flex: 0 0 atuo;
      position: relative;
      margin-left: 15px;
      .field-box {
        position: absolute;
        top: 40px;
        left: 0;
        right: -40px;
        z-index: 99;
        border: 1px solid #2175a9;
        background: #002a44;
        border-radius: 5px;
        ul {
          padding: 10px;
          li {
            padding: 1px 0;
          }
        }
        .btn {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 5px;
          border-top: 1px solid #2175a9;
          color: #fff;
          p {
            flex: 1;
            text-align: center;
            cursor: pointer;
            &:hover {
              color: #49bbeb;
            }
          }
        }
      }
    }
  }
  .desc {
    margin-bottom: 20px;
  }
  .condition {
    margin-bottom: 15px;
  }
  .ep-table {
    .examine-0 {
      color: #ffbd29;
    }
    .examine-1 {
      //color: #28ffad;
      color: #16a5a5;
    }
    .examine-2 {
      color: #fe5756;
      cursor: pointer;
    }
  }
  ::v-deep .vxe-checkbox--label {
    padding-left: 12px;
    color: #fff;
  }
  ::v-deep .vxe-checkbox--icon {
    box-shadow: none !important;
  }
  ::v-deep .vxe-table--filter-wrapper {
    .vxe-checkbox--label {
      color: #333;
    }
    .is--checked {
      .vxe-checkbox--label {
        color: #2466d0;
      }
    }
  }
}
</style>
<style lang="less">
.r-reason {
  .ant-tooltip-arrow::before {
    background: #2175a9;
  }
  .ant-tooltip-inner {
    border: 1px solid #2175a9;
    background: #002a44;
    color: #49bbeb;
  }
}
</style>

